package com.etc;

import java.util.Random;

/**
 * 敌机
 */
public class Airplane extends
        FlyingObject implements Enemy{
    //步数
    private int speed = 2;


    public Airplane() {
        image = AircraftwarGame.airplane;
        width = image.getWidth();
        height = image.getHeight();
        Random random = new Random();
        x = random.nextInt(AircraftwarGame.WIDTH - this.width);
        y = -height;
    }

    @Override
    public int getScore() {
        return 5;
    }


    @Override
    public void step() {
        y = y + speed;
    }

    @Override
    public boolean outBounds() {
        return  this.y > AircraftwarGame.HEIGHT ? true:false ;
    }
}
